$dir = '/data1/bsi/BORA_processing/devel/eqtl/parallelize_genotypingsurvival/Matrix_eQTL_R_Source';
#$files= `ls $dir/results_permutation_onlyids/`;
$files= `ls $dir/ORI/`;
@files = split("\n",$files);
$snpfiles = `ls $dir/SNP/`;
@snpfiles = split("\n",$snpfiles);
#open(WRBUFF,">file_param_manual_glm");
open(WRBUFF,">ori_file_param_manual_glm");
for($i=0;$i<@files;$i++)
{
	chomp($files[$i]);
	$files[$i] =~ s/ //g;
	$files[$i] =~ s/\t//g;
	if($files[$i] ne "")
	{
		#print $files[$i]."\n";
		for($y=0;$y<@snpfiles;$y++)
		{
			$outfile = $y+1;
			$outfile ="result_$outfile"."_$files[$i]";
			#print WRBUFF "$dir/results_permutation_onlyids/$files[$i] $dir/results_permutation_manual_glm/$outfile  $dir/results_permutation/order_$files[$i] $dir/SNP/$snpfiles[$y]\n"; 
			print WRBUFF "$dir/ORI/$files[$i] $dir/ori_results_permutation_manual_glm/$outfile  $dir/SNP/$snpfiles[$y]\n";
		}
	}
}
